package com.qimei.onerice.service.impl;

import com.qimei.onerice.dao.CustomerDao;
import com.qimei.onerice.dao.DishCategoryDao;
import com.qimei.onerice.dao.impl.CustomerDaoImpl;
import com.qimei.onerice.dao.impl.DishCategoryDaoImpl;
import com.qimei.onerice.entity.Customer;
import com.qimei.onerice.entity.DishCategory;
import com.qimei.onerice.service.DishCategoryService;

import java.util.List;

public class DishCategoryServiceImpl implements DishCategoryService {
	DishCategoryDao dishCategoryDao = new DishCategoryDaoImpl();
	
	@Override
	public List<DishCategory> getDishCategoryList() {
		return dishCategoryDao.getDishCategoryList();
	}

	@Override
	public boolean deleteDishCategory(int dishCategoryId) {
		int result = dishCategoryDao.deleteDishCategory(dishCategoryId);
		return result > 0;
	}

	@Override
	public boolean updateDishCategory(DishCategory dishCategory) {
		int result = dishCategoryDao.updateDishCategory(dishCategory);
		return result > 0;
	}

	@Override
	public boolean addDishCategory(DishCategory dishCategory) {
		int result = dishCategoryDao.addDishCategory(dishCategory);
		return result > 0;
	}

	@Override
	public DishCategory getDishCategoryById(int dishCategoryId) {
		return dishCategoryDao.getDishCategoryById(dishCategoryId);
	}
}
